<!--
 * @Author: wu07 1732042133@qq.com
 * @Date: 2023-02-01 16:58:23
 * @LastEditors: wu07 1732042133@qq.com
 * @LastEditTime: 2023-02-03 16:43:22
 * @FilePath: \recruitAPP\recruitApp\recruitApp\src\pages\user\Me\Opinion.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 视图层 -->
<template>
  <van-nav-bar
    title="意见反馈"
    left-text="返回"
    left-arrow
    @click-left="onClickLeft"
  />
  <div class="body">
    <div class="content" v-for="(value, index) in arr" :key="inex">
      <div class="one">
        <span>反馈类型：{{ value.type }}</span
        ><van-button plain :type="value.color" class="bt">{{
          value.state
        }}</van-button>
      </div>
      <div class="two">
        <span>内容：{{ value.content }}</span>
      </div>
    </div>
  </div>
  <van-button type="primary" block @click="runAdd">添加反馈</van-button>
</template>
<!-- 逻辑层 -->
<script setup>
import { ref } from "vue";
import { get, post, put, del, patch } from "~/axios/http";
// 导入useRouter方法
import { useRouter } from "vue-router";
const router = useRouter();
// 返回上一页
const onClickLeft = () => {
  router.go(-1);
};
const runAdd = () => {
  router.push("/add");
};
const value = ref("");
const arr = ref([]);
async function message() {
  let id = ref(localStorage.getItem("key"));
  let res1 = await get(`/api/infomation/${id.value}`);
  console.log(res1.data.num7);
  arr.value = res1.data.num7;
}
message();
</script>
<!-- 样式层 -->
<style  scoped>
.content {
  width: 100%;
  padding: 4vw 0;
  border: 0.2667vw solid #e6e6e6;
}
.content div {
  width: 90%;
  margin: 0 auto;
}
.one {
  display: flex;
  justify-content: space-between;
  align-content: center;
}
.two {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.body {
  margin-bottom: 5.3333vw;
}
.bt {
  width: 14.3333vw !important;
  padding: 0.2667vw !important;
  height: 8.6667vw;
}
</style>